<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="../plugins/layui/css/layui.css" media="all" />
    <link rel="stylesheet" href="../plugins/layui/css/myPage.css">

</head>
<body  style=" overflow-x:hidden;">
<div class="layui-container">


    <form class="layui-form">
        <div class="layui-row">
            <div class="layui-col-md12">

                <fieldset class="layui-elem-field" style="margin-top: 20px;">
                    <legend>驾驶员基本信息</legend>


                    <div class="layui-form-item">
                        <label class="layui-form-label"><span style="color: red;">*</span>驾驶员姓名 </label>
                        <div class="layui-input-inline" style="width: 150px;">
                            <input   type="text" name="jsyxm"  required lay-verify="required" placeholder="请输入"  class="layui-input"  >
                            <input   type="hidden" name="sjid"    id="sjid"  class="layui-input"  >
                        </div>


                        <label class="layui-form-label"><span style="color: red;">*</span>部门</label>

                        <div class="layui-input-inline" style="width: 150px;">
                            <input type="hidden" name="bumenid" id="bumenValue">
                            <select name="bumenid" required lay-verify="required"  lay-verify="required" id="bumen" lay-search >
                                <option value=""></option>
                            </select>
                        </div>
                        <div class="layui-inline">
                            <label class="layui-form-label" style="width: 90px"><span style="color: red;">*</span>驾驶员手机</label>
                            <div class="layui-input-inline" style="width: 150px;">
                                <input type="text" name="jsysj" required lay-verify="required" placeholder="请输入"  class="layui-input">
                            </div>
                        </div>
                        <div class="layui-inline">
                            <label class="layui-form-label" style="width: 70px">岗位</label>
                            <div class="layui-input-inline" style="width: 150px;">
                                <select name="gangwei" >
                                    <option value=""></option>
                                    <option value="主驾">主驾</option>
                                    <option value="副驾">副驾</option>
                                </select>
                            </div>
                        </div>


                    </div>
                    <div class="layui-form-item">

                        <label class="layui-form-label"><span style="color: red;">*</span>身份证号</label>
                        <div class="layui-input-inline" style="width: 150px;">
                            <input   type="text" name="sfzh"  required lay-verify="required" placeholder="请输入"  class="layui-input"  >
                        </div>

                        <label class="layui-form-label"> 身份证所在地</label>
                        <div class="layui-input-inline" style="width: 150px;">
                            <input   type="text" name="sfzszd"    placeholder="请输入"  class="layui-input"  >
                        </div>


                        <!--<label class="layui-form-label">原驾驶车牌号</label>-->

                        <!--<div class="layui-input-inline" style="width: 150px;">-->
                        <!--<input type="hidden" name="yjscph" id="yjscphValue">-->
                        <!--<select name="yjscph"    lay-search   id="yjscph" >-->
                        <!--<option value=""></option>-->
                        <!--</select>-->
                        <!--</div>-->
                        <label class="layui-form-label" style="width: 90px">原驾驶车牌号</label>
                        <div class="layui-input-inline" style="width: 150px;">
                            <input   type="text" name="yjscph"    placeholder="请输入"  class="layui-input"  >
                        </div>

                    </div>
                    <div class="layui-form-item">


                        <div class="layui-inline">
                            <label class="layui-form-label">在职状态</label>
                            <div class="layui-input-inline" style="width: 150px;">
                                <select name="zzzt" >
                                    <option value=""></option>
                                    <option value="在职">在职</option>
                                    <option value="离职">离职</option>
                                </select>
                            </div>
                        </div>

                        <div class="layui-inline">
                            <label class="layui-form-label" style="width: 78px">合同编号</label>
                            <div class="layui-input-inline" style="width: 150px;">
                                <input   type="text" name="htbh"    placeholder="请输入"  class="layui-input"  >
                            </div>
                        </div>
                        <div class="layui-inline">
                            <label class="layui-form-label" style="width: 78px">合同有效期</label>
                            <div class="layui-input-inline" style="width: 150px;">
                                <input type="text" name="htyxrq" class="layui-input" id="htyxq">
                            </div>
                        </div>
                        <div class="layui-inline">

                            <label class="layui-form-label" style="width: 75px;">辞职日期</label>
                            <div class="layui-input-inline" style="width: 150px;">
                                <input type="text" name="czrq" class="layui-input" id="czrq">
                            </div>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">备注</label>
                        <div class="layui-input-inline" style="width:1000px ;">
                            <input   type="text" name="beizhu"    placeholder="请输入"  class="layui-input"  >
                        </div>

                    </div>

                    <div class="layui-form-item">

                        <div class="layui-inline" style="width: auto">
                            <label class="layui-form-label" > 身份证正面</label>
                            <input type="hidden" name="sfzfyj" autocomplete="off" class="layui-input" id="sfzfyj">

                            <button type="button" class="layui-btn layui-btn-normal  layui-btn-disabled" disabled  id="sfzfyjBtn" style="display: none" >上传文件</button>
                            <button type="button" class="layui-btn layui-btn-normal  "   id="looksfzfyjBtn" style="display: none">查看文件</button>


                            <button type="button" class="layui-btn layui-btn-normal  layui-btn-disabled" disabled  style="display: none" id="delsfzfyjBtn">删除文件</button>

                        </div>
                        <div class="layui-inline" style="width: auto">
                            <label class="layui-form-label" > 身份证反面</label>
                            <input type="hidden" name="sfzfm" autocomplete="off" class="layui-input" id="sfzfm">

                            <button type="button" class="layui-btn layui-btn-normal  layui-btn-disabled" disabled  id="sfzfmBtn" style="display: none" >上传文件</button>
                            <button type="button" class="layui-btn layui-btn-normal  "   id="looksfzfmBtn" style="display: none">查看文件</button>


                            <button type="button" class="layui-btn layui-btn-normal  layui-btn-disabled" disabled  style="display: none" id="delsfzfmBtn">删除文件</button>

                        </div>
                        <div class="layui-inline" style="width: auto">
                            <label class="layui-form-label" > 手举身份证上半身照</label>
                            <input type="hidden" name="sjsfzsbsz" autocomplete="off" class="layui-input" id="sjsfzsbsz">

                            <button type="button" class="layui-btn layui-btn-normal  layui-btn-disabled" disabled  id="sjsfzsbszBtn" style="display: none" >上传文件</button>
                            <button type="button" class="layui-btn layui-btn-normal  "   id="looksjsfzsbszBtn" style="display: none">查看文件</button>


                            <button type="button" class="layui-btn layui-btn-normal  layui-btn-disabled" disabled  style="display: none" id="delsjsfzsbszBtn">删除文件</button>

                        </div>
                    </div>


                    <div class="layui-form-item">


                        <div class="layui-inline">
                            <label class="layui-form-label" > 健康证明照片</label>
                            <input type="hidden" name="jkzmzp" autocomplete="off" class="layui-input" id="jkzmzp">

                            <button type="button" class="layui-btn layui-btn-normal  layui-btn-disabled" disabled  id="jkzmzpBtn" style="display: none" >上传文件</button>
                            <button type="button" class="layui-btn layui-btn-normal  "   id="lookjkzmzpBtn" style="display: none">查看文件</button>

                            <button type="button" class="layui-btn layui-btn-normal  layui-btn-disabled" disabled style="display: none" id="deljkzmzpBtn">删除文件</button>

                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label"  style="width: 90px;">有无遗传病</label>
                        <div class="layui-input-inline" style="width: 400px;">
                            <input   type="text" name="ywycb"    placeholder="若有请具体填写"  class="layui-input"  >
                        </div>
                        <label class="layui-form-label"  style="width: 150px;">有无药物过敏史</label>
                        <div class="layui-input-inline" style="width: 400px;">
                            <input   type="text" name="ywywgm"    placeholder="若有请具体填写"  class="layui-input"  >
                        </div>

                    </div>
                </fieldset>
            </div>
        </div>
        <div class="layui-row">
            <div class="layui-col-md12">
                <fieldset class="layui-elem-field" style="margin-top: 20px;">
                    <legend>紧急联系人</legend>


                    <div class="layui-form-item">
                        <label class="layui-form-label"> 姓名 </label>
                        <div class="layui-input-inline" style="width: 150px;">
                            <input   type="text" name="jjlxrxm"   id="jjlxrxm" placeholder="请输入"  class="layui-input"  >
                            <input   type="hidden" name="jjlxrm"   id="jjlxrData"    >
                        </div>





                        <label class="layui-form-label" style="width: 92px"> 关系</label>

                        <div class="layui-input-inline" style="width: 150px;">
                            <input   type="text" name="jjlxrgx"   id="jjlxrgx" placeholder="请输入"  class="layui-input"  >
                        </div>

                        <div class="layui-inline">
                            <label class="layui-form-label" style="width: 82px">联系方式</label>
                            <div class="layui-input-inline" style="width: 150px;">
                                <input   type="text" name="jjlxrlxfs" id="jjlxrlxfs"   placeholder="请输入"  class="layui-input"  >
                            </div>
                        </div>

                        <div class="layui-inline">
                            <label class="layui-form-label" style="width: 75px">工作单位</label>
                            <div class="layui-input-inline" style="width: 150px;">
                                <input type="text" name="jjlxrgzdw"  placeholder="请输入"  id="jjlxrgzdw"  class="layui-input">
                            </div>
                        </div>
                        <div class="layui-inline" style="position: relative;left: 87%">
                            <button type="button" class="layui-btn layui-btn-normal" id="addEmcPer">添加到下方</button>
                        </div>
                    </div>


                    <div class="layui-form-item">
                        <div class="layui-form-item">

                            <script type="text/html" id="opera">
                                <button class="layui-btn layui-btn-danger layui-btn-xs delEmcPerson layui-btn-disabled"  disabled lay-event="del">删除</button>
                            </script>
                            <table id="jjlxr" lay-filter="jjlxr"></table>

                        </div>

                    </div>



                </fieldset>
            </div>
        </div>
        <div class="layui-row">
            <div class="layui-col-md12">

                <fieldset class="layui-elem-field" style="margin-top: 20px;">
                    <legend>驾驶员证件信息</legend>

                    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
                        <legend>驾驶证</legend>
                    </fieldset>
                    <div class="layui-form-item">
                        <div class="layui-inline">
                            <label class="layui-form-label"><span style="color: red;">*</span>驾驶证号</label>
                            <div class="layui-input-inline" style="width: 150px;">
                                <input   type="text" name="jszh"  required lay-verify="required" placeholder="请输入"  class="layui-input"  >
                            </div>
                        </div>

                        <div class="layui-inline">
                            <label class="layui-form-label"> 档案号</label>
                            <div class="layui-input-inline" style="width: 150px;">
                                <input type="text" name="dah"   lay-verify=" " placeholder="请输入"  class="layui-input">
                            </div>

                        </div>
                        <div class="layui-inline">
                            <label class="layui-form-label"> 发证机关</label>
                            <div class="layui-input-inline" style="width: 355px;">
                                <input   type="text" name="jszfzjg"    placeholder="请输入"  class="layui-input"  >
                            </div>
                        </div>




                    </div>

                    <div class="layui-form-item">
                        <div class="layui-inline">
                            <label class="layui-form-label"><span style="color: red;">*</span>初领日期</label>
                            <div class="layui-input-inline" style="width: 150px;">
                                <input type="text" name="jszclrq" class="layui-input" id="jszclrq" required lay-verify="required">
                            </div>
                        </div>

                        <div class="layui-inline">
                            <label class="layui-form-label"><span style="color: red;">*</span>有效期止</label>
                            <div class="layui-input-inline" style="width: 150px;">
                                <input type="text" name="jszyxqz" class="layui-input" id="jszyxqz" required lay-verify="required">
                            </div>
                        </div>

                        <div class="layui-inline">
                            <label class="layui-form-label"><span style="color: red;">*</span>驾驶证年检日期</label>
                            <div class="layui-input-inline" style="width: 150px;">
                                <input type="text" name="jsznjrq" class="layui-input" id="jsznjrq" required lay-verify="required">
                            </div>
                        </div>


                    </div>
                    <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label" > 驾驶证照片（正本）</label>
                        <input type="hidden" name="jszfyj" autocomplete="off" class="layui-input" id="jszfyj">

                        <button type="button" class="layui-btn layui-btn-normal  layui-btn-disabled" disabled   id="jszfyjBtn" style="display: none" >上传文件</button>
                        <button type="button" class="layui-btn layui-btn-normal  "   id="lookjszfyjBtn" style="display: none">查看文件</button>

                        <button type="button" class="layui-btn layui-btn-normal  layui-btn-disabled" disabled  style="display: none" id="deljszfyjBtn">删除文件</button>

                    </div>
                        <div class="layui-inline">
                            <label class="layui-form-label" > 驾驶证照片（副本）</label>
                            <input type="hidden" name="jszfb" autocomplete="off" class="layui-input" id="jszfb">

                            <button type="button" class="layui-btn layui-btn-normal  layui-btn-disabled" disabled   id="jszfbBtn" style="display: none" >上传文件</button>
                            <button type="button" class="layui-btn layui-btn-normal  "   id="lookjszfbBtn" style="display: none">查看文件</button>

                            <button type="button" class="layui-btn layui-btn-normal  layui-btn-disabled" disabled  style="display: none" id="deljszfbBtn">删除文件</button>

                        </div>
                    </div>
                    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
                        <legend>从业资格证</legend>
                    </fieldset>
                    <div class="layui-form-item">
                        <label class="layui-form-label"><span style="color: red;">*</span>从业资格证号</label>
                        <div class="layui-input-inline" style="width: 150px;">
                            <input   type="text" name="cyzgzh"    placeholder="请输入"  class="layui-input" required lay-verify="required" >
                        </div>


                        <div class="layui-inline">
                            <label class="layui-form-label"> 发证机关</label>
                            <div class="layui-input-inline" style="width: 380px;">
                                <input type="text" name="cyzgzfzjg"  placeholder="请输入"  class="layui-input"  >
                            </div>


                            <div class="layui-inline">
                                <label class="layui-form-label"><span style="color: red;">*</span>初领日期</label>
                                <div class="layui-input-inline" style="width: 150px;">
                                    <input type="text" name="cyzgzclrq" class="layui-input" id="cyzgzclrq" required lay-verify="required">
                                </div>
                            </div>



                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-inline">
                            <label class="layui-form-label"><span style="color: red;">*</span>有效期止</label>
                            <div class="layui-input-inline" style="width: 150px;">
                                <input type="text" name="cyzgzyxqz" class="layui-input" id="cyzgzyxqz" required lay-verify="required">
                            </div>
                        </div>

                            <div class="layui-inline">
                                <label class="layui-form-label"><span style="color: red;">*</span>从业资格证年检日期</label>
                                <div class="layui-input-inline" style="width: 150px;">
                                    <input type="text" name="cyzgznjrq" class="layui-input" id="cyzgznjrq" required lay-verify="required">
                                </div>
                            </div>

                    </div>
                    <div class="layui-form-item">

                        <div class="layui-inline">

                            <label class="layui-form-label" style="width: 80px">从业资格证1</label>

                            <input type="hidden" name="cyzgzfyj" autocomplete="off" class="layui-input" id="cyzgzfyj">

                            <button type="button" class="layui-btn layui-btn-normal  layui-btn-disabled" disabled   id="cyzgzfyjBtn" style="display: none" >上传文件</button>
                            <button type="button" class="layui-btn layui-btn-normal  "   id="lookcyzgzfyjBtn" style="display: none">查看文件</button>


                            <button type="button" class="layui-btn layui-btn-normal  layui-btn-disabled" disabled style="display: none" id="delcyzgzfyjBtn">删除文件</button>
                        </div>
                        <div class="layui-inline">
                            <label class="layui-form-label" > 从业资格证2</label>
                            <input type="hidden" name="cyzgz2" autocomplete="off" class="layui-input" id="cyzgz2">

                            <button type="button" class="layui-btn layui-btn-normal  layui-btn-disabled" disabled   id="cyzgz2Btn" style="display: none" >上传文件</button>
                            <button type="button" class="layui-btn layui-btn-normal  "   id="lookcyzgz2Btn" style="display: none">查看文件</button>

                            <button type="button" class="layui-btn layui-btn-normal  layui-btn-disabled" disabled  style="display: none" id="delcyzgz2Btn">删除文件</button>

                        </div>
                        <div class="layui-inline">
                            <label class="layui-form-label" > 从业资格证3</label>
                            <input type="hidden" name="cyzgz3" autocomplete="off" class="layui-input" id="cyzgz3">

                            <button type="button" class="layui-btn layui-btn-normal  layui-btn-disabled" disabled   id="cyzgz3Btn" style="display: none" >上传文件</button>
                            <button type="button" class="layui-btn layui-btn-normal  "   id="lookcyzgz3Btn" style="display: none">查看文件</button>

                            <button type="button" class="layui-btn layui-btn-normal  layui-btn-disabled" disabled  style="display: none" id="delcyzgz3Btn">删除文件</button>

                        </div>
                    </div>
                        <div class="layui-form-item">


                            <div class="layui-inline">
                                <label class="layui-form-label" > 从业资格证4</label>
                                <input type="hidden" name="cyzgz4" autocomplete="off" class="layui-input" id="cyzgz4">

                                <button type="button" class="layui-btn layui-btn-normal  layui-btn-disabled" disabled   id="cyzgz4Btn" style="display: none" >上传文件</button>
                                <button type="button" class="layui-btn layui-btn-normal  "   id="lookcyzgz4Btn" style="display: none">查看文件</button>

                                <button type="button" class="layui-btn layui-btn-normal  layui-btn-disabled" disabled  style="display: none" id="delcyzgz4Btn">删除文件</button>

                            </div>

                            <div class="layui-inline">
                                <label class="layui-form-label" > 从业资格证5</label>
                                <input type="hidden" name="cyzgz5" autocomplete="off" class="layui-input" id="cyzgz5">

                                <button type="button" class="layui-btn layui-btn-normal  layui-btn-disabled" disabled   id="cyzgz5Btn" style="display: none" >上传文件</button>
                                <button type="button" class="layui-btn layui-btn-normal  "   id="lookcyzgz5Btn" style="display: none">查看文件</button>

                                <button type="button" class="layui-btn layui-btn-normal  layui-btn-disabled" disabled  style="display: none" id="delcyzgz5Btn">删除文件</button>

                            </div>

                        </div>
                    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
                        <legend>押运证</legend>
                    </fieldset>
                    <div class="layui-form-item">
                        <div class="layui-inline">
                            <label class="layui-form-label">押运证号</label>
                            <div class="layui-input-inline" style="width: 150px;">
                                <input type="text" name="yyzh" placeholder="请输入"  class="layui-input">
                            </div>
                        </div>

                        <div class="layui-inline">
                            <label class="layui-form-label" style="width: 78px;">发证机关</label>
                            <div class="layui-input-inline" style="width: 380px;">
                                <input type="text" name="yyzfzjg"   placeholder="请输入"  class="layui-input">
                            </div>
                        </div>


                        <div class="layui-inline">
                            <label class="layui-form-label" style="width: 78px;">初领日期</label>
                            <div class="layui-input-inline" style="width: 150px;">
                                <input type="text" name="yyzclrq" class="layui-input" id="yyzclrq">
                            </div>
                        </div>



                    </div>
                    <div class="layui-form-item">
                        <div class="layui-inline">
                            <label class="layui-form-label"> 有效期止</label>
                            <div class="layui-input-inline" style="width: 150px;">
                                <input type="text" name="yyzyxqz" class="layui-input" id="yyzyxqz"  >
                            </div>
                        </div>
                        <div class="layui-inline">
                            <label class="layui-form-label" style="width: 78px;"> 复印件</label>
                            <input type="hidden" name="yyzfyj" autocomplete="off" class="layui-input" id="yyzfyj">

                            <input   type="hidden" name="isU"    id="isU"   >
                            <button type="button" class="layui-btn layui-btn-normal layui-btn-disabled" disabled  id="yyzfyjBtn" style="display: none" >上传文件</button>
                            <button type="button" class="layui-btn layui-btn-normal  "   id="lookyyzfyjBtn" style="display: none">查看文件</button>

                            <button type="button" class="layui-btn layui-btn-normal layui-btn-disabled" disabled style="display: none" id="delyyzfyjBtn">删除文件</button>

                        </div>
                    </div>

                </fieldset>
            </div>
        </div>
        <button type="button" class="layui-btn layui-btn-normal"  id="modiInfo" style="width: 10%; position: absolute;left: 55%" >修改信息</button>
        <button id="modiSub" class="layui-btn layui-btn-normal layui-btn-disabled" disabled lay-submit lay-filter="update" style="width: 10%; position: absolute;left: 35%"  >立即提交</button>
    </form>
</div>
<script src="../plugins/layui/layui.js"></script>
<script src="../js/config.js"></script>
<script src="../js/tools.js"></script>
<script>
    layui.use([ 'form','layer','laydate','upload','table'],function () {

        var form = layui.form;
        var $ = layui.$;
        var layer = layui.layer;
        var laydate = layui.laydate;
        var upload = layui.upload;
        var table = layui.table;
        $(".layui-input").addClass("layui-disabled");
        $(".layui-input").attr("disabled",true);
        // $(".delEmcPerson").addClass("layui-btn-disabled");
        // $(".delEmcPerson").attr("disabled",true);
        //role
        if($("#isU").val() == "false"){
            $("#modiInfo").attr("disabled",true);
            $("#modiInfo").addClass("layui-btn-disabled");
        }
        $("select").attr("disabled","disabled");
        $("#addEmcPer").attr("disabled",true);
        $("#addEmcPer").addClass("layui-btn-disabled");
        $("#modiInfo").on('click',function(){
            $(".layui-input").removeClass("layui-disabled");
            $(".layui-input").attr("disabled",false);
            $("#modiSub").removeClass("layui-btn-disabled");
            $("#modiSub").removeAttr("disabled");

            $("#sfzfyjBtn").removeClass("layui-btn-disabled");
            $("#sfzfyjBtn").removeAttr("disabled");
            $("#delsfzfyjBtn").removeClass("layui-btn-disabled");
            $("#delsfzfyjBtn").removeAttr("disabled");
            $("#jkzmzpBtn").removeClass("layui-btn-disabled");
            $("#jkzmzpBtn").removeAttr("disabled");
            $("#deljkzmzpBtn").removeClass("layui-btn-disabled");
            $("#deljkzmzpBtn").removeAttr("disabled");
            $("#cyzgzfyjBtn").removeClass("layui-btn-disabled");
            $("#cyzgzfyjBtn").removeAttr("disabled");
            $("#delcyzgzfyjBtn").removeClass("layui-btn-disabled");
            $("#delcyzgzfyjBtn").removeAttr("disabled");
            $("#yyzfyjBtn").removeClass("layui-btn-disabled");
            $("#yyzfyjBtn").removeAttr("disabled");
            $("#delyyzfyjBtn").removeClass("layui-btn-disabled");
            $("#delyyzfyjBtn").removeAttr("disabled");
            $("#jszfyjBtn").removeClass("layui-btn-disabled");
            $("#jszfyjBtn").removeAttr("disabled");
            $("#deljszfyjBtn").removeClass("layui-btn-disabled");
            $("#deljszfyjBtn").removeAttr("disabled");
            $("#sfzfmBtn").removeClass("layui-btn-disabled");
            $("#sfzfmBtn").removeAttr("disabled");
            $("#delsfzfmBtn").removeClass("layui-btn-disabled");
            $("#delsfzfmBtn").removeAttr("disabled");
            $("#sjsfzsbszBtn").removeClass("layui-btn-disabled");
            $("#sjsfzsbszBtn").removeAttr("disabled");
            $("#delsjsfzsbszBtn").removeClass("layui-btn-disabled");
            $("#delsjsfzsbszBtn").removeAttr("disabled");
            $("#jszfbBtn").removeClass("layui-btn-disabled");
            $("#jszfbBtn").removeAttr("disabled");
            $("#deljszfbBtn").removeClass("layui-btn-disabled");
            $("#deljszfbBtn").removeAttr("disabled");
            $("#cyzgz2Btn").removeClass("layui-btn-disabled");
            $("#cyzgz2Btn").removeAttr("disabled");
            $("#delcyzgz2Btn").removeClass("layui-btn-disabled");
            $("#delcyzgz2Btn").removeAttr("disabled");
            $("#cyzgz3Btn").removeClass("layui-btn-disabled");
            $("#cyzgz3Btn").removeAttr("disabled");
            $("#delcyzgz3Btn").removeClass("layui-btn-disabled");
            $("#delcyzgz3Btn").removeAttr("disabled");
            $("#cyzgz4Btn").removeClass("layui-btn-disabled");
            $("#cyzgz4Btn").removeAttr("disabled");
            $("#delcyzgz4Btn").removeClass("layui-btn-disabled");
            $("#delcyzgz4Btn").removeAttr("disabled");
            $("#cyzgz5Btn").removeClass("layui-btn-disabled");
            $("#cyzgz5Btn").removeAttr("disabled");
            $("#delcyzgz5Btn").removeClass("layui-btn-disabled");
            $("#delcyzgz5Btn").removeAttr("disabled");



            $("#modiInfo").addClass("layui-btn-disabled");
            $("#modiInfo").attr("disabled",true);
            $("#addEmcPer").attr("disabled",false);
            $("#addEmcPer").removeClass("layui-btn-disabled");
            $(".delEmcPerson").attr("disabled",false);
            $(".delEmcPerson").removeClass("layui-btn-disabled");
            $("select").removeAttr("disabled");
            form.render('select');
        });

        //渲染紧急联系人表格
        var jjlxrArr = JSON.parse( $("#jjlxrData").val());
        console.log(jjlxrArr);
        table.render({
            elem:'#jjlxr'
            ,page:true
            ,cellMinWidth: 80
            ,data:jjlxrArr
            ,limit:5
            ,cols: [[
                {type:'numbers', title: '序号',  align:'center'}
                ,{field:'jjlxrxm', title: '姓名' ,align: 'center' }
                ,{field:'jjlxrgx', title: '关系' ,align: 'center' }
                ,{field:'jjlxrlxfs', title: '联系方式' ,align: 'center' }
                ,{field:'jjlxrgzdw', title: '工作单位' ,align: 'center' }
                ,{fixed: 'right',title:'操作', align:'center', toolbar: '#opera' ,width:150}

            ]]
        });
        //校验
        // judgment($,'jjlxrxm',/^[\u4E00-\u9FA5A-Za-z]+$/,"只能输入中文和英文");
        // judgment($,'jjlxrgx',/^[\u4E00-\u9FA5A-Za-z]+$/,"只能输入中文和英文");
        // judgment($,'jjlxrgzdw',/^[\u4E00-\u9FA5A-Za-z]+$/,"只能输入中文和英文");
        // judgment($,'jjlxrlxfs',/^\d{11}$/,"请输入正确的手机号码");

        $("#addEmcPer").on('click',function () {
            console.log(jjlxrArr);
            var elem = {};
            var jjlxrxm = $("#jjlxrxm").val();
            var jjlxrgx = $("#jjlxrgx").val();
            var jjlxrlxfs = $("#jjlxrlxfs").val();
            var  jjlxrgzdw = $("#jjlxrgzdw").val();
            $("#jjlxrxm").val("");
            $("#jjlxrgx").val("");
            $("#jjlxrlxfs").val("");
            $("#jjlxrgzdw").val("");
            if(jjlxrxm &&jjlxrgx&&jjlxrlxfs&&jjlxrgzdw){
                elem.jjlxrxm = jjlxrxm;
                elem.jjlxrgx = jjlxrgx;
                elem.jjlxrlxfs = jjlxrlxfs;
                elem.jjlxrgzdw = jjlxrgzdw;

                jjlxrArr.push(elem);

                table.render({
                    elem:'#jjlxr'
                    ,page:true
                    ,cellMinWidth: 80
                    ,data:jjlxrArr
                    ,limit:5
                    ,cols: [[
                        {type:'numbers', title: '序号',  align:'center'}
                        ,{field:'jjlxrxm', title: '姓名' ,align: 'center' }
                        ,{field:'jjlxrgx', title: '关系' ,align: 'center' }
                        ,{field:'jjlxrlxfs', title: '联系方式' ,align: 'center' }
                        ,{field:'jjlxrgzdw', title: '工作单位' ,align: 'center' }
                        ,{fixed: 'right',title:'操作', align:'center', toolbar: '#opera' ,width:150}

                    ]]
                });
                $(".delEmcPerson").attr("disabled",false);
                $(".delEmcPerson").removeClass("layui-btn-disabled");
            }else {
                layer.msg("紧急联系人信息不能为空");
            }
        });
        //yjs车牌号

        // $.ajax({
        //     url: contextPath+"/car",
        //     type: "GET",
        //     contentType:"application/json;charset=utf-8",
        //     dataType:"json",
        //     success: function(res) {
        //         for(var i in res.list){
        //
        //             if(res.list[i].clid  == $("#yjscphValue").val()){
        //                 var option = "<option value='"+ res.list[i].clid+ "' selected >"+res.list[i].cph+"</option>";
        //             }else {
        //                 var option = "<option value='"+ res.list[i].clid+ "'>"+res.list[i].cph+"</option>";
        //             }
        //
        //             $("#yjscph").append(option);
        //         };
        //
        //
        //         form.render('select');
        //     }
        //
        // });


        //渲染部门select
        $.ajax({
            url: contextPath+"/deptlist",
            type: "GET",
            contentType:"application/json;charset=utf-8",
            dataType:"json",
            success: function(res) {
                for(var i in res.list){

                    if(res.list[i].bumenid  == $("#bumenValue").val()){
                        var option = "<option value='"+ res.list[i].bumenid+ "' selected >"+res.list[i].name+"</option>";
                    }else {
                        var option = "<option value='"+ res.list[i].bumenid+ "'>"+res.list[i].name+"</option>";
                    }

                    $("#bumen").append(option);
                };


                form.render('select');
            }

        });


        checkFile($,$("#jkzmzp").val(),"jkzmzp");
        checkFile($,$("#sfzfyj").val(),"sfzfyj");
        checkFile($,$("#cyzgzfyj").val(),"cyzgzfyj");
        checkFile($,$("#yyzfyj").val(),"yyzfyj");
        checkFile($,$("#jszfyj").val(),"jszfyj");
        checkFile($,$("#sfzfm").val(),"sfzfm");
        checkFile($,$("#sjsfzsbsz").val(),"sjsfzsbsz");
        checkFile($,$("#jszfb").val(),"jszfb");
        checkFile($,$("#cyzgz2").val(),"cyzgz2");
        checkFile($,$("#cyzgz3").val(),"cyzgz3");
        checkFile($,$("#cyzgz4").val(),"cyzgz4");
        checkFile($,$("#cyzgz5").val(),"cyzgz5");





        download($,layer,"sfzfyj");
        download($,layer,"jszfyj");
        download($,layer,"jkzmzp");
        download($,layer,"cyzgzfyj");
        download($,layer,"yyzfyj");
        download($,layer,"sfzfm");
        download($,layer,"sjsfzsbsz");
        download($,layer,"jszfb");
        download($,layer,"cyzgz2");
        download($,layer,"cyzgz3");
        download($,layer,"cyzgz4");
        download($,layer,"cyzgz5");

        uploadOneFile(upload,$,layer,"driver",$("#sjid").val(),"jkzmzp");
        uploadOneFile(upload,$,layer,"driver",$("#sjid").val(),"sfzfyj");
        uploadOneFile(upload,$,layer,"driver",$("#sjid").val(),"jszfyj");
        uploadOneFile(upload,$,layer,"driver",$("#sjid").val(),"cyzgzfyj");
        uploadOneFile(upload,$,layer,"driver",$("#sjid").val(),"yyzfyj");
        uploadOneFile(upload,$,layer,"driver",$("#sjid").val(),"sfzfm");
        uploadOneFile(upload,$,layer,"driver",$("#sjid").val(),"sfzfm");
        uploadOneFile(upload,$,layer,"driver",$("#sjid").val(),"sjsfzsbsz");
        uploadOneFile(upload,$,layer,"driver",$("#sjid").val(),"jszfb");
        uploadOneFile(upload,$,layer,"driver",$("#sjid").val(),"cyzgz2");
        uploadOneFile(upload,$,layer,"driver",$("#sjid").val(),"cyzgz3");
        uploadOneFile(upload,$,layer,"driver",$("#sjid").val(),"cyzgz4");
        uploadOneFile(upload,$,layer,"driver",$("#sjid").val(),"cyzgz5");







        var delFileArr = new Array();
        delFile($,layer,"jkzmzp",delFileArr);
        delFile($,layer,"sfzfyj",delFileArr);
        delFile($,layer,"jszfyj",delFileArr);
        delFile($,layer,"cyzgzfyj",delFileArr);
        delFile($,layer,"yyzfyj",delFileArr);
        delFile($,layer,"sfzfm",delFileArr);
        delFile($,layer,"sjsfzsbsz",delFileArr);
        delFile($,layer,"jszfb",delFileArr);
        delFile($,layer,"cyzgz2",delFileArr);
        delFile($,layer,"cyzgz3",delFileArr);
        delFile($,layer,"cyzgz4",delFileArr);
        delFile($,layer,"cyzgz5",delFileArr);



        lookFile($,layer,"jkzmzp");
        lookFile($,layer,"sfzfyj");
        lookFile($,layer,"jszfyj");
        lookFile($,layer,"cyzgzfyj");
        lookFile($,layer,"yyzfyj");
        lookFile($,layer,"sfzfm");
        lookFile($,layer,"sjsfzsbsz");
        lookFile($,layer,"jszfb");
        lookFile($,layer,"cyzgz2");
        lookFile($,layer,"cyzgz3");
        lookFile($,layer,"cyzgz4");
        lookFile($,layer,"cyzgz5");


        table.on('tool(jjlxr)', function(obj){
            var data = obj.data //获得当前行数据
                ,layEvent = obj.event; //获得 lay-event 对应的值
            if(layEvent === 'del'){

                console.log(obj.data);
                console.log(jjlxrArr);
                $.each(jjlxrArr,function (i,e) {
                    if(e.jjlxrgx == data.jjlxrgx && e.jjlxrgzdw == data.jjlxrgzdw && e.jjlxrlxfs == data.jjlxrlxfs && e.jjlxrxm == data.jjlxrxm){
                        jjlxrArr.splice(i,1);

                        return false;
                    }
                })
                table.render({
                    elem:'#jjlxr'
                    ,page:true
                    ,cellMinWidth: 80
                    ,data:jjlxrArr
                    ,limit:5
                    ,cols: [[
                        {type:'numbers', title: '序号',  align:'center'}
                        ,{field:'jjlxrxm', title: '姓名' ,align: 'center' }
                        ,{field:'jjlxrgx', title: '关系' ,align: 'center' }
                        ,{field:'jjlxrlxfs', title: '联系方式' ,align: 'center' }
                        ,{field:'jjlxrgzdw', title: '工作单位' ,align: 'center' }
                        ,{fixed: 'right',title:'操作', align:'center', toolbar: '#opera' ,width:150}

                    ]]
                });
                $(".delEmcPerson").attr("disabled",false);
                $(".delEmcPerson").removeClass("layui-btn-disabled");

            }
        });


        laydate.render({
            elem: '#htyxrq' //指定元素
            ,type: 'date'
            ,format:'yyyy-MM-dd'
        });
        laydate.render({
            elem: '#czrq' //指定元素
            ,type: 'date'
            ,format:'yyyy-MM-dd'
        });
        laydate.render({
            elem: '#jszclrq' //指定元素
            ,type: 'date'
            ,format:'yyyy-MM-dd'
        });
        laydate.render({
            elem: '#jszyxqz' //指定元素
            ,type: 'date'
            ,format:'yyyy-MM-dd'
        });
        laydate.render({
            elem: '#cyzgzclrq' //指定元素
            ,type: 'date'
            ,format:'yyyy-MM-dd'
        });
        laydate.render({
            elem: '#cyzgzyxqz' //指定元素
            ,type: 'date'
            ,format:'yyyy-MM-dd'
        });
        laydate.render({
            elem: '#yyzclrq' //指定元素
            ,type: 'date'
            ,format:'yyyy-MM-dd'
        });
        laydate.render({
            elem: '#yyzyxqz' //指定元素
            ,type: 'date'
            ,format:'yyyy-MM-dd'
        });
        laydate.render({
            elem: '#htyxq' //指定元素
            ,type: 'date'
            ,format:'yyyy-MM-dd'
        });


        form.on('submit(update)', function(data){
            data.field.jjlxrm = JSON.stringify(jjlxrArr) ;
            $("input").css("border","");
            for(var fileindex in delFileArr){
                $.ajax({
                    url: contextPath+"/files/"+delFileArr[fileindex],
                    type: "DELETE",
                    contentType:"application/json;charset=utf-8",
                    dataType:"json",
                    success: function(res) {

                    }

                });
            }
            $.ajax({
                url: contextPath+"/driver",
                type: "PUT",
                contentType:"application/json;charset=utf-8",
                data: JSON.stringify(data.field) ,
                dataType:"json",
                success: function(res) {
                    updateSuccess($,layer,res)
                }
            });
            return false; //阻止表单跳转。如果需要表单跳转，去掉这段即可。
        });
    });

</script>
</body>
</html>